﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


class SieveOfEratosthenes
{
    static void Main()
    {
        
        int end = 100;
        bool[] e = new bool[end];//by default they're all false

        for (int i = 2; i < end; i++)
        {
            e[i] = true;//set all numbers to true
        }

        //weed out the non primes by finding mutiples 
        for (int j = 2; j < end; j++)
        {
            if (e[j])//is true
            {
                for (long p = 2; (p * j) < end; p++)
                {
                    e[p * j] = false;
                }
            }
        }

        for (int i = 0; i < end; i++)
        {
            if (e[i])
            {
                Console.WriteLine(i);
            }
        }
    }
}

